<?php
/**
 * class cr_data_crime
 *
 * @uses Blib_Data_Model_Base
 * @implements
 * @author  Generator <generator>
 * @copyright Centrebet 2009
 */
class cr_data_crime extends Blib_Data_Model_Base
{
    /**
     * table name
     * must be set within each object
     *
     * @access protected
     */
    protected $tableName = '';


    /**
     * unique id
     * must be set within each object
     *
     * @access protected
     */
    protected $keys = '';

    /**
     * the internal data KEY array
     * used for internal objects/values attached to this object
     * MUST BE SET BEFORE HAND
     *
     * @format array['name' => 'type']
     * @access protected
     * @var    array
     */
    protected $internalVars = array(
    );


    /**
     * the external data KEY array
     * used for external objects/values attached to this object
     * so it doesn't ruin the rawData which will be used to save into db
     * IT STORES ONLY THE KEYS - SO WHEN USING GETRAWDATA, THESE ARE EXEMPTED
     * MUST BE SET BEFORE HAND
     *
     * @format array['name' => 'type']
     * @access protected
     * @var    array
     */
    protected $externalVars = array(
       'id' => 'int',
       'date' => 'str',
       'title' => 'str',
       'name' => 'str',
       'image' => 'str',
       'link' => 'str',
    );


/*--------------------------------------[getters]--------------------------------------*/

    /**
     * get id: the id
     *
     * @return int
     */
    public function getId()
    {
        return $this->_getVar('id');

    }// end getId


    /**
     * get date: the date when it happened
     *
     * @return str
     */
    public function getDate()
    {
        return $this->_getVar('date');

    }// end getDate


    /**
     * get title: the brief description
     *
     * @return str
     */
    public function getTitle()
    {
        return $this->_getVar('title');

    }// end getTitle


    /**
     * get name: who's involved
     *
     * @return str
     */
    public function getName()
    {
        return $this->_getVar('name');

    }// end getName


    /**
     * get image: the picture
     * @param str $extra if not null, do an image tag
     * @return str
     */
    public function getImage($extra = null)
    {
        $img = $this->_getVar('image');
        if (!empty($extra) && $img != 'N/A' && $img != '') {
            $img = "<img src=\"$img\" $extra />";
        }
        return $img;

    }// end getImage


    /**
     * get link: the link to the article
     * @param str $title the title piece
     * @param str $extra extra bit in it
     * @return str
     */
    public function getLink($title = null, $extra = null)
    {
        $lnk = $this->_getVar('link');
        if (!empty($title) && $lnk != 'N/A' && $lnk != '') {
            $lnk = "<a href=\"$lnk\" $extra>$title</a>";
        }
        return $lnk;

    }// end getLink


/*--------------------------------------[setters]--------------------------------------*/

    /**
     * set id
     *
     * @param int $Id the id
     *
     * @return cr_data_crime
     */
    public function setId($Id)
    {
        return $this->_setVar('id', $Id);

    }// end setId


    /**
     * set date
     *
     * @param str $Date the date when it happened
     *
     * @return cr_data_crime
     */
    public function setDate($Date)
    {
        return $this->_setVar('date', $Date);

    }// end setDate


    /**
     * set title
     *
     * @param str $Title the brief description
     *
     * @return cr_data_crime
     */
    public function setTitle($Title)
    {
        return $this->_setVar('title', $Title);

    }// end setTitle


    /**
     * set name
     *
     * @param str $Name who's involved
     *
     * @return cr_data_crime
     */
    public function setName($Name)
    {
        return $this->_setVar('name', $Name);

    }// end setName


    /**
     * set image
     *
     * @param str $Image the picture
     *
     * @return cr_data_crime
     */
    public function setImage($Image)
    {
        return $this->_setVar('image', $Image);

    }// end setImage


    /**
     * set link
     *
     * @param str $Link the link to the article
     *
     * @return cr_data_crime
     */
    public function setLink($Link)
    {
        return $this->_setVar('link', $Link);

    }// end setLink


/*--------------------------------------[special function]--------------------------------------*/

}// end cr_data_crime
?>